<template>
    <div>
        <public-header></public-header>
        <van-cell-group class='messageList'>
            <van-cell 
                v-for="(item,index) in list" 
                :key='index' 
                :title="item.fmessagecontent" 
                :value="item.fmessagedate"
                @click="mesClick(item)"
                is-link />
        </van-cell-group>
        <public-footer :active='active'></public-footer>
    </div>
</template>

<script>
import  publicHeader  from '@/components/publicHeader';
import  publicFooter  from '@/components/publicFooter';
import {
    getMessage
} from '@/api/gov/message';
import { 
    Tabbar, 
    TabbarItem ,
    Icon ,
    Cell,
<<<<<<< HEAD
     CellGroup 
=======
    CellGroup 
>>>>>>> zcm
} from 'vant';
export default {
    name: 'footerBtn',
    components: {
        publicFooter,
        publicHeader,
        [Cell.name]:Cell,
        [CellGroup.name]:CellGroup,
        [Tabbar.name]:Tabbar,
        [Icon.name]:Icon,
        [TabbarItem.name]:TabbarItem,
    },
    data () {
        return {
            list:[]
        }
    },
    created(){
        this.active = 'mes'
        getMessage({
            fopenid:'ainiaini'
        }).then(res=>{
<<<<<<< HEAD
            console.log(res)
=======
>>>>>>> zcm
            if(res.isSuccess){
                this.list = res.list
            }
        })
    },
    methods:{
        mesClick(item){
            if(item.ffunctionid  == 'managercrud_register'){
                this.$router.push({
                    path: '/govLogon',
                    query:
                    {
                        fid:item.ffunctionrecordid,
                        ffunctionid:item.ffunctionid,
                        fappstatusid:item.fappstatusid
                    }
                });
            }else if(item.ffunctionid == 'managercrud_register_person'){
                this.$router.push({
                    path: '/normalLogon',
                    query:
                    {
                        fid:item.ffunctionrecordid,
                        ffunctionid:item.ffunctionid,
                        fappstatusid:item.fappstatusid
                    }
                });
            }
        }
    }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
.messageList .van-cell__title{
    text-align: left;
}
</style>
